import request from '@/utils/request'

/**
 * 登录接口
 * @param {Object} data: {account, password}
 * @return Promise
 */
export const loginAPI = (data) => {
  return request({
    url: '/user/login',
    method: 'POST',
    data
  })
}

/**
 * 发送手机验证码
 * @param phone
 * @return Promise
 */
export const sendCodeAPI = (data) => {
  return request({
    url: '/user/get_code',
    method: 'POST',
    data
  })
}

/**
 * 修改密码
 * @param {Object} data: {password, code, type}
 * @return Promise
 */
export const updatePwdAPI = (data) => {
  return request({
    url: '/user/password',
    method: 'PATCH',
    data
  })
}
